<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>MocuGame_Library Sprite Example</title>

	<script src="js/mocugame-min-0.9.1.js"></script>

    <link rel="stylesheet" type="text/css" href="css/default.css" />

</head>
<body>
    <canvas id="myCanvas"></canvas>
    <script>
        MocuGame.targetResolutionWidth = 640;
        MocuGame.prepareCanvas("myCanvas", new MocuGame.Point(640, 480), new MocuGame.Point(640, 480));
        var sprite = new MocuGame.MocuSprite(new MocuGame.Point(0, 0), new MocuGame.Point(32, 32), "images/Mocuto.png");
        sprite.addAnimation("Dance", "0,1 1,1 2,1 3,1 4,1", 10, true);
        sprite.play("Dance");
        sprite.velocity.x = 2;
        sprite.fade.r = 1;
        sprite.fade.a = 1;
        sprite.isMovementPolar = true;
        var slot = new MocuGame.TimeSlot(10);
        slot.addEvent(new MocuGame.Event(sprite, "fade.a", 1, 0, 30));
        sprite.timeline.addSlot(slot);

        var emitter = new MocuGame.MocuEmitter(new MocuGame.Point(320, 240), sprite, 120, new Array("fade.r", "fade.a", "isMovementPolar"), { "velocity.y": new Array(0, 360)}, sprite.timeline);
        emitter.particleLife = 40;

        var state = new MocuGame.MocuState(60);

        state.add(emitter);

        MocuGame.init(state);

    </script>
</body>
</html>
